package com.health.warehouse.model.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 跨医院药物调取申请表
 * @TableName medicineTransfer
 */
@TableName(value ="medicineTransfer")
@Data
public class Medicinetransfer implements Serializable {
    /**
     * 申请唯一id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 申请药物调取医院ID
     */
    private Long fromHospitalId;

    /**
     * 物品id
     */
    private Long itemId;

    /**
     * 授权药物调用医院ID(被调取)
     */
    private Long toHospitalId;

    /**
     * 药物、器材、样本名称
     */
    private String itemName;

    /**
     * 物品类别（药物、器材、病人样本、其它）
     */
    private Integer itemType;

    /**
     * 调取数量
     */
    private Integer quantity;

    /**
     * 是否已经通过申请
     */
    private Integer isAuthorized;

    /**
     * 是否已经调取完毕
     */
    private Integer isCompleted;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 是否删除 0-未删除 1-已删除
     */
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Medicinetransfer other = (Medicinetransfer) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getFromHospitalId() == null ? other.getFromHospitalId() == null : this.getFromHospitalId().equals(other.getFromHospitalId()))
            && (this.getToHospitalId() == null ? other.getToHospitalId() == null : this.getToHospitalId().equals(other.getToHospitalId()))
            && (this.getItemName() == null ? other.getItemName() == null : this.getItemName().equals(other.getItemName()))
            && (this.getItemType() == null ? other.getItemType() == null : this.getItemType().equals(other.getItemType()))
            && (this.getQuantity() == null ? other.getQuantity() == null : this.getQuantity().equals(other.getQuantity()))
            && (this.getIsAuthorized() == null ? other.getIsAuthorized() == null : this.getIsAuthorized().equals(other.getIsAuthorized()))
            && (this.getIsCompleted() == null ? other.getIsCompleted() == null : this.getIsCompleted().equals(other.getIsCompleted()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getFromHospitalId() == null) ? 0 : getFromHospitalId().hashCode());
        result = prime * result + ((getToHospitalId() == null) ? 0 : getToHospitalId().hashCode());
        result = prime * result + ((getItemName() == null) ? 0 : getItemName().hashCode());
        result = prime * result + ((getItemType() == null) ? 0 : getItemType().hashCode());
        result = prime * result + ((getQuantity() == null) ? 0 : getQuantity().hashCode());
        result = prime * result + ((getIsAuthorized() == null) ? 0 : getIsAuthorized().hashCode());
        result = prime * result + ((getIsCompleted() == null) ? 0 : getIsCompleted().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", fromHospitalId=").append(fromHospitalId);
        sb.append(", toHospitalId=").append(toHospitalId);
        sb.append(", itemName=").append(itemName);
        sb.append(", itemType=").append(itemType);
        sb.append(", quantity=").append(quantity);
        sb.append(", isAuthorized=").append(isAuthorized);
        sb.append(", isCompleted=").append(isCompleted);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}